#include<bits/stdc++.h>
using namespace std;
int main()
{
    int N, len = 0, i, j, x;
    char s[1100];
    memset(s, 0, 1100);
    scanf("%d", &N);
    getchar();
    while ((s[len] = getchar()) != '\n')
    {
        len++;
    }
    if (len % N != 0)
    {
        for (i = 0, x = len; i < N - len % N; i++)
            s[x++] = ' ';
    }
    else
        x = len;
    for (i = 0; i < N; i++)
    {
        for (j = x / N - 1; j >= 0; j--)
        {
            printf("%c", s[j * N + i]);
        }
        printf("\n");
    }
}

/**
#include<bits/stdc++.h>
using namespace std;
int main() {
    int n;
    cin >> n;
    string str;
    getchar();
    getline(cin, str);
    int len = str.length();
    int mod = len % n;
    mod = n - mod;
    while (mod--) {
        str += " ";
    }
    vector<vector<char> > res;
    vector<char> temp;
    for (unsigned int i = 0; i < str.length(); i++) {
        temp.push_back(str[i]);
        if ((i + 1) % n == 0) {
            res.push_back(temp);
            temp.clear();
        }
    }
    
    for (int row = 0; row < res[0].size(); row++) {
        for (int col = res.size() - 1; col >= 0; col--) printf("%c",res[col][row]);
        cout << endl;
    }
    return 0;
}
 * */
